package asteroids.model.expressions;

import java.util.HashMap;
import asteroids.model.*;

/**
 * A subclass of expression (E) that represents a double
 * 
 * @version 1.0
 * 
 * @author	Thijs Peirelinck & Wouter Parys
 *
 */
public class DoubleLiteral extends BasicExpression {

	private double d;
	
	public DoubleLiteral(double d) {
		this.d = d;
	}
	
	@Override
	public Double getValue() {
		return d;
	}
	
	@Override
	public boolean isValidExpression() {
		return true;
	}
	
	@Override
	public String getReturnType() {
		return "double";
	}
	
	@Override
	public String toString() {
		return "" + d;
	}
	
	@Override
	public DoubleLiteral createCopy() {
		return new DoubleLiteral(this.d);
	}
	
	@Override
	public void setExecuter(Ship executer) {
		//do nothing
	}
	
	@Override
	public void validate(HashMap<String, E> variables) {
		//do nothing
	}
}
